

% diary 'flyfly.txt'
% diary on;
t= 0:1:360;
V1=82.5;
V2=100;
a=0.95;
L1=4000;
plan=zeros(1,7*5);

%% 开始循环过程
for M =180000:-1000:10000 
for L1=4000:2000:10000
for V1 =50:2:80
for V2=50:2:80
        
         panduan=0;
        
    
 
     for a=0.3:0.1:0.5
     for y2=0:M/10:M/2
     for y1 = M/2:M/10:M
        
          
            [t,xxyy] = ode45( @(t,y)fly_the_air(t,y,L1,V1,V2,a,M),t,[0,M/2,50000,y1,50000,y2]);
            [status ,tt] = check_status(xxyy,M);
%             disp(status);
%             plot(xxyy(:,1),xxyy(:,2),'-k');
%             disp(status);
%  status 的状态
%  0 - 未知
% 1 - 拦截成功
% -1  ： 曲率不满足条件
% 2 ： 突围成功
%             if status ==2 %%%%突围了....
%             
%                 cross1 =1;
%                 panduan=1;
%             end
            if status ==1
                    panduan=1;
             break
            end
            
            
            
      end
                if(panduan==1)
                         break
                end
       
      end
                if(panduan==1)
                    
                    break
                end
     end
         
      
     if(panduan==0)
       disp(M);
        disp("--ok--");
        break;
   end
     
    end

     if(panduan==0)
        break;
   end

end

 if(panduan==0)
        break;
   end

end
end
% diary off;